<?xml version='1.0' encoding='UTF-8' ?>

<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:c="http://java.sun.com/jsp/jstl/core"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:fn="http://java.sun.com/jsp/jstl/functions"
                xmlns:h="http://java.sun.com/jsf/html"
                template="/WEB-INF/templates/default.xhtml">

    <ui:define name="content">
         <f:metadata>
            <f:viewParam name="id" value="#{storeId}" />
            <f:event type="preRenderView" listener="#{deliveryManager.loadDelivery(storeId)}" />
        </f:metadata>
        <h:dataTable class="table table-striped table-bordered" value="#{deliveryManager.delivery.packages}" var="package" rendered="#{not empty deliveryManager.delivery.packages}">
            <h:column>
                <f:facet name="header">ID</f:facet>
                <h:outputText value="#{package.id}"/>
            </h:column>
            <h:column>
                <f:facet name="header">#{msg['package.height']}</f:facet>
                <h:outputText value="#{package.height}"/>
            </h:column>
            <h:column>
                <f:facet name="header">#{msg['package.width']}</f:facet>
                <h:outputText value="#{package.width}"/>
            </h:column>
            <h:column>
                <f:facet name="header">#{msg['package.weight']}</f:facet>
                <h:outputText value="#{package.weight}"/>
            </h:column>
            <h:column>
                <f:facet name="header">#{msg['package.price']}</f:facet>
                <h:outputText value="#{package.price}"/>
            </h:column>
        </h:dataTable>
        <h:button class="btn" outcome="/pages/admin/delivery" value="#{msg['form.back']}"/>
    </ui:define>
</ui:composition>

